package vn.outsource.weather.ui;

import vn.tdx.androidlibs.ui.BaseFragmentActivity;
import android.os.Bundle;
import android.support.v4.app.FragmentTabHost;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.com.outsource.weather.R;

public class RadarActivity extends BaseFragmentActivity implements
		OnClickListener {

	private ImageView mimgLeftNavigation;
	private ImageView mimgRighNavigation;
	private TextView mtxtTitle;
	private ImageView mimgForward;
	private ImageView mimgNext;
	private ImageView mimgPlay;

	private FragmentTabHost mTabHost;

	@Override
	protected void setContentView(Bundle bundle) {
		setContentView(R.layout.activity_radar);
	}

	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);

		mtxtTitle = (TextView) findViewById(R.id.cv_navigation_bar_txt_title);
		mimgLeftNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_left);
		mimgRighNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_right);
		mimgRighNavigation.setImageResource(R.drawable.btn_add_highlight);
		mimgLeftNavigation.setImageResource(R.drawable.btn_back);
		mimgLeftNavigation.setImageResource(R.drawable.btn_back);
		mimgForward = (ImageView) findViewById(R.id.activity_radar_img_forward);
		mimgNext = (ImageView) findViewById(R.id.activity_radar_img_next);
		mimgPlay = (ImageView) findViewById(R.id.activity_radar_img_play);

		mimgRighNavigation.setVisibility(View.INVISIBLE);

		mtxtTitle.setText("Radar");

		mimgLeftNavigation.setOnClickListener(this);
		mimgRighNavigation.setOnClickListener(this);

		mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
		mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);

		Bundle b = new Bundle();
		b.putString("key", "Simple");
		mTabHost.addTab(mTabHost.newTabSpec("RainSnow")
				.setIndicator("RainSnow"), RainSnowFragment.class, b);
		//
		b = new Bundle();
		b.putString("key", "Contacts");
		mTabHost.addTab(
				mTabHost.newTabSpec("Temperature").setIndicator("Temperature"),
				TemperatureFragment.class, b);
		// b = new Bundle();
		// b.putString("key", "Custom");
		// mTabHost.addTab(mTabHost.newTabSpec("custom").setIndicator("Custom"),
		// Fragment3.class, b);
	}

	@Override
	protected boolean isNavigationEnable() {
		return false;
	}

	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.cv_navigation_bar_img_left) {
			finish();
		}
	}

}
